FROM billryan/gitbook as builder

COPY . /work

WORKDIR /work

RUN gitbook install && \
	gitbook build && \
	find . -name "*.html" -type f -exec sed -i -r 's/(powered by Gitbook)/<a href="https:\/\/beian.miit.gov.cn\/" target="_blank">沪ICP备2021005264号-1<\/a>/g' {} \;

FROM nginx:1.13.12-alpine

COPY --from=builder /work/_book /usr/share/nginx/html
